﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="adminProductAttribute.aspx.cs" Inherits="Admin_adminProductAttribute" %>
<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
     <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="imgs/GetAjax.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/common.js"></script>
</head>
<body onload="$('#loading').hide()">
    <form id="form1" runat="server">
<div class="container" id="cpcontainer">
<div id="loading" style="display:block">   
        <div class="loading-indicator">   
            页面正在加载中...   
        </div>   
</div>
<table class="tb">
<tr class="thead"><th colspan="15">
    数据管理(产品数据:如果您推荐了产品又同时把产品标识为最新和首页展示，那么这个产品有可能重复显示)</th></tr>	
<tr><td align="left" colspan="10">  

关键字<input  name="keyword" type="text" id="keyword" size="20" value="">

<input type="button" name="selectBtn"  value="查 询..." class="btn" onclick='SelectKey("?")'/>&nbsp;

</td>
</tr>
<tr bgcolor="#f5fafe">
    <td style="width: 5%">ID<a href="#"><img src="imgs/minus.gif" title="按ID排序" /></a></td>
    <td style="width: 15%">产品名称</td>
    <td style="width:10%">属性类别</td>
    <td style="width: 10%">属性内容</td>
    <td style="width: 10%">属性链接</td>
    <td style="width: 40%" align="left">操作</td>
</tr>  
      <asp:Repeater ID="Repeater1" runat="server">
      <ItemTemplate>
<tr bgcolor="#f5fafe">
	<td ><input type="checkbox" value='<%#Eval("ProductAttributeID") %>' name="m_id"   class="checkbox" /><%#Eval("ProductAttributeID")%></td>
	<td ><%#getProductName(Eval("ProductID"))%></td>
    <td><%#getAttributeName(Eval("AttributeID"))%></td>	
	<td maxlength="10"><%#Eval("ProductAttributeValue") %></td>
	<td><%#Eval("ProductAttributeUrl") %></td>	
	<td style="width: 600px">
	  <input id="Button5" type="button" value="编辑" class='btn' title='<%#Eval("ProductAttributeID") %>' onclick="javascript:location.href='EditProductAttribute.aspx?action=edit&id='+this.title"/>
	   <input id="btnDel" type="button" value="删除" class='btn' title='<%#Eval("ProductAttributeID") %>' onclick="if(confirm('确定要删除吗')){$('#loading').show();ajax_get('adminProductAttribute.aspx?action=delAll&id='+this.title,'',function(msg){$('#cpcontainer').empty().append(msg);$('#loading').hide()});}else{return false}"/>
	</td>
  </tr>        
      </ItemTemplate>
      </asp:Repeater>

<tr><td colspan="11"><div class="cuspages"><div class="pages" id="pro" runat="server">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll(this.checked,'m_id')" />反选<input type="checkbox" name="chkothers" id="chkothers" class="checkbox" onclick="checkOthers('m_id')" />
<input type="button" value="批量删除" onclick="doPostDeletes('','m_id')" class="btn"  /> 
<input type="button" value="批量修改" class="btn" onclick="doPostEdit('','m_id')" />&nbsp;

<input type="button"   value="批量移动" class="btn" onclick="doPostMove('','m_id')"/>&nbsp;
    </div></div></td>
</tr>

<tr><td colspan="11"><div class="cuspages"><%PagingHtml();%><div class="pages">
</div></div></td>
</tr>
</table>
  <uc1:adminfoot ID="Adminfoot1" runat="server" />
</div>
<%--删除,移动,修改start--%>
<script type="text/javascript" >

    function  doPostDeletes(url,sname)
    {    
                
        var ids=getIDList(sname);
        if(ids!="")
        {
            if((confirm("确定要删除这些记录?"))==true)
            {
                $("#loading").show();
                url=convertURL(url+"?action=delAll&id="+ids+$("#HiddenUrl").attr("value"));
                $("#loading").show();
                ajax_get(url,'',function(msg)
                {
                   $("#cpcontainer").empty().append(msg);
                   $("#loading").hide();
                });
	        }
	    }
	    else
	    {
	        alert("您还没有选择要删除的项");	        
	        return false;
	    }
    }
    
    function  doPostEdit(url,sname)
    {    
     
        var ids=getIDList(sname);
        var Param='';
        if(ids!="")
        {
            if((confirm("确定要批量修改这些记录?"))==true)
            {   $("#loading").show();    
                  url=url+"?action=editAll&id="+ids+$("#HiddenUrl").attr("value"); 
                  for(var i=0;i<=ids.split(',').length-1;i++)
                  { 
                     var id=ids.split(',')[i];
                     Param+= "&psort"+id+"="+$("input[name='psort"+id+"']").attr("value")+
                             "&pview"+id+"="+$("input[name='pview"+id+"']").attr("value")+
                             "&isBast"+id+"="+$("input[name='isBast"+id+"']").attr("title")+
                             "&IsNew"+id+"="+$("input[name='IsNew"+id+"']").attr("title")+
                             "&isIndex"+id+"="+$("input[name='isIndex"+id+"']").attr("title")+
                             "&isCan"+id+"="+$("input[name='isCan"+id+"']").attr("title");                             
                  }
                  ajax_post(url,Param,function(msg,date)
                  {
                        $("#cpcontainer").empty().append(msg);
                        $("#loading").hide();                  
                  });
	        }
	    }
	    else
	    {
	        alert("您还没有选择要修改的项");	    
	        return;
	    }
    }
    
    function doPostMove(url,sname)
    {
     
        var ids=getIDList(sname);
        if(ids!="")
        {
            var yidong="";
            var Param="";
            yidong=$("#pro #pctp option:selected").attr("value");
            if((confirm("确定要移动这些记录?"))==true)
            {   $("#loading").show();
                url=convertURL(url+"?action=MoveAll&id="+yidong+"&pid="+ids+$("#HiddenUrl").attr("value"));
                 $("#loading").show();
                ajax_get(url,'',function(msg)
                {
                     $("#cpcontainer").empty().append(msg);
                     $("#loading").hide();
                    
                });
	        }
	    }
	    else
	    {
	        alert("您还没有选择移动项");	 
	        return false;
	    }
    } 
    
   function SelectKey(url)
   {
      $("#loading").show();
      url=convertURL("?key="+escape($("#keyword").attr("value"))+"&ClassId="+$("#pclassType option:selected").attr("value")+"&CurrentIndex=1");
       $("#loading").show();
      ajax_get(url,'',function(msg)
      {
        $("#cpcontainer").empty().append(msg);
        $("#loading").hide();
      });
       
   }
   
  function doGetIsBool(url,em,type,name)
  {
      url=convertURL("?action="+type+"&bo="+em.title+"&id="+em.lang+$("#HiddenUrl").attr("value"));
      $("#loading").show();
      ajax_get(url,'',function(msg)
      {
        if(msg==name)
        {
         
            $("#"+em.id).attr("value",name);
            $("#"+em.id).attr("title","false");
            $("#loading").hide();
        }
        else
        {
             $("#"+em.id).attr("value","已"+name);
              $("#"+em.id).attr("title","true");
             if(msg=="已屏蔽")
             {
                location.href=location.href;
             }
             $("#loading").hide();
        }
      });
  }
  
 </script>
<%--删除,移动,修改end--%>
    <script type="text/javascript" >
    function changePage(name)
    {

    }
    </script>
    
      
</form>
</body>
</html>
